package com.chinaunicom.emergency.model;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 事故报告
 *
 * @author liuzhuang
 * @date 2020-8-5
 */
@Entity
@Getter
@Setter
@EqualsAndHashCode
@Table(name = "xxjb_acc_report")
@ApiModel(value = "事故报告")
public class AccReport implements Serializable {
    @Id
    @GenericGenerator(name = "accReportUUID", strategy = "uuid")
    @GeneratedValue(generator = "accReportUUID")
    private String pid;

    @Column(name = "org_id")
    @ApiModelProperty(value = "org_id", dataType = "String")
    private String orgId;

    @Column(name = "dept_id")
    @ApiModelProperty(value = "部门id", dataType = "String")
    private String deptId;

    @Column(name = "acc_name")
    @ApiModelProperty(value = "事故名称", dataType = "String")
    private String accName;

    @Column(name = "acc_site")
    @ApiModelProperty(value = "事故地点", dataType = "String")
    private String accSite;

    @Column(name = "acc_type")
    @ApiModelProperty(value = "事故类型", dataType = "String")
    private String accType;

    @Column(name = "acc_level")
    @ApiModelProperty(value = "事故等级", dataType = "String")
    private String accLevel;

    @Column(name = "acc_brief")
    @ApiModelProperty(value = "事故概述", dataType = "String")
    private String accBrief;

    @Column(name = "govern_unit")
    @ApiModelProperty(value = "主管单位", dataType = "String")
    private String governUnit;

    @Column(name = "belong_area")
    @ApiModelProperty(value = "所辖区域", dataType = "String")
    private String belongArea;

    @Column(name = "impact_area")
    @ApiModelProperty(value = "影响区域", dataType = "String")
    private String impactArea;

    @Column(name = "acc_start_time")
    @ApiModelProperty(value = "事故开始时间", dataType = "Date")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date accStartTime;

    @Column(name = "acc_end_time")
    @ApiModelProperty(value = "事故结束时间", dataType = "Date")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date accEndTime;

    @Column(name = "person_death_num")
    @ApiModelProperty(value = "死亡人数", dataType = "Integer")
    private Integer personDeathNum;

    @Column(name = "person_miss_num")
    @ApiModelProperty(value = "失踪人数", dataType = "Integer")
    private Integer personMissNum;

    @Column(name = "person_injured_num")
    @ApiModelProperty(value = "受伤人数", dataType = "Integer")
    private Integer personInjuredNum;

    @Column(name = "person_serious_num")
    @ApiModelProperty(value = "重伤人数", dataType = "Integer")
    private Integer personSeriousNum;

    @Column(name = "acc_summary")
    @ApiModelProperty(value = "事故概括", dataType = "String")
    private String accSummary;

    @Column(name = "acc_company_condition")
    @ApiModelProperty(value = "事故单位情况", dataType = "String")
    private String accCompanyCondition;

    @Column(name = "eco_loss_direct")
    @ApiModelProperty(value = "直接经济损失", dataType = "String")
    private String ecoLossDirect;

    @Column(name = "acc_detail_report")
    @ApiModelProperty(value = "事故详细报告", dataType = "String")
    private String accDetailReport;

    @Column(name = "other_thing")
    @ApiModelProperty(value = "其他", dataType = "String")
    private String otherThing;

    @Column(name = "rescure_state")
    @ApiModelProperty(value = "是否启动", dataType = "Integer")
    private Integer rescureState;

    @Column(name = "acc_longitude")
    @ApiModelProperty(value = "事件经度", dataType = "String")
    private String accLongitude;

    @Column(name = "acc_latitude")
    @ApiModelProperty(value = "事件纬度", dataType = "String")
    private String accLatitude;

    @Column(name = "attachment_id")
    @ApiModelProperty(value = "上传报告ID", dataType = "String")
    private String attachmentId;

    @Column(name = "is_storage")
    @ApiModelProperty(value = "一键入库", dataType = "Integer")
    private Integer isStorage;

    @Column(name = "create_by")
    @ApiModelProperty(value = "创建人", dataType = "String")
    private String createBy;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间", dataType = "Date")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Column(name = "update_by")
    @ApiModelProperty(value = "修改人", dataType = "String")
    private String updateBy;

    @Column(name = "update_time")
    @ApiModelProperty(value = "修改时间", dataType = "Date")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @Column(name = "is_soft_del")
    @ApiModelProperty(value = "是否软删除", dataType = "Integer")
    private Integer isSoftDel;

    @Column(name = "delete_by")
    @ApiModelProperty(value = "删除人", dataType = "String")
    private String deleteBy;

    @Column(name = "delete_time")
    @ApiModelProperty(value = "删除时间", dataType = "Date")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date deleteTime;


    @Override
    public String toString(){
        return JSONObject.toJSONString(this);
    }
}